﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MallInteractiveMap.CMSWebClient.Presenter;
using MallInteractiveMap.DTO;

namespace MallInteractiveMap.CMSWebClient.Handler
{
    /// <summary>
    /// Summary description for ImageHandler
    /// </summary>
    public class ImageHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            DTOMall mall = new MallPresenter().GetMalls().FirstOrDefault();
            if (mall == null) return;

            context.Response.ContentType = mall.FileType;
            context.Response.BinaryWrite(mall.Logo);
            context.Response.End();


        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}